﻿<?php
require_once("include/common.inc.php");
require_once("include/dedesql.class.php");

$title = '法制天下 - 合同范本';
require_once('common/header.php');
?>
<div class="meun2 clearfix">
	<dl>
		<dd><a href="" class="contract_a_01"><span>合同范本</span></a></dd>
	</dl>
</div>

<div class="index_box_contract clearfix">
<!--- 案例检索  start------>
		<div class="cn_box01">
			<h2 class="box_title">案例检索</h2>
			<dl class="contract_form clearfix">
				<form>
				<dt><img src="images/fs.gif" alt="法搜"/></dt>
				<dd><input id="" type="text" value="" name="" style="width:500px"/></dd>
				<dd><input id="" type="button" name="" value=" " class="fs_but_01"/></dd>
				</form>
			</dl>
		<p class="contract_hot_key">
		热门搜索：
		<?php
		
		$dsql->SetQuery("select * from object_city_title");
		$dsql->Execute();
		$arr = Array();
		while($row = $dsql->GetArray())
		{
			echo "<a href=\"/content-list.php?tid=227&oname=18&ovalue=".$row['id']."\" target=\"_blank\">".$row['val']."</a>";
		}
		?>
		</p>
   	<div class="height_10"></div>
		</div>
<!--- end------>
   	<div class="height_10"></div>
	<div class="left">
<!--- 最新合同  start------>
		<div class="cn_box01 height269">
			<h2 class="box_title">最新合同</h2>
			<?php
			$dsql->SetQuery("select a.* From cms_archives a, cms_arctiny b where a.typeid = '218' and a.id=b.id and b.arcrank != '-2' order by a.id desc limit 2");
			$dsql->Execute();
			while($row = $dsql->GetArray())
			{
			?>
				<dl class="zx_ht">
					<dt class="blue"> <?=$row['title']?></dt>
					<dd><?=SubTitle($row['description'], 72)?></dd>
					<span class="all_act"> <a href="./info.php?id=<?=$row['id']?>" target="_blank">[阅读全文]</a>（<?=date('Y-m-d', $row['senddate'])?>）</span>
				</dl>
			<?php
			}
			?>
			<ul class="two_row_box07 no_ico clearfix">
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=1" target="_blank" class="blue">[买卖合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '1' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
				
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=2" target="_blank" class="blue">[租赁合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '2' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
				
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=3" target="_blank" class="blue">[劳动合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '3' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
				
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=4" target="_blank" class="blue">[服务合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '4' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
				
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=5" target="_blank" class="blue">[借款合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '5' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
				
				<li class="clearfix"><a href="/content-list.php?tid=218&oname=18&ovalue=6" target="_blank" class="blue">[代理合同]</a>
				<?php
				$row = $dsql->GetOne("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '6' order by a.id desc limit 1");
				echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],50)."</a></li>";
				?>
			</ul>
		</div>
<!--- end------> 
   	<div class="height_3"></div>
<!--- 栏目分类  start------>
		<div class="cn_box01">
			<h2 class="box_title">栏目分类</h2>
			<div class="two_row_box06 clearfix">
				<!-- <dl class="clearfix"> -->
				<?php
				$dsql->SetQuery("select * from object_contract_type");
				$dsql->Execute();
				$i = 1;
				$arr = Array();
				while($row = $dsql->GetArray())
				{
					$arr[$i][0] = $row['id'];
					$arr[$i][1] = $row['val'];
					$i++;
				
				}
				for($i = 1; $i < (count($arr) + 1); $i++){
				?>
					<dl>
						<dt><a href="/content-list.php?tid=218&oname=18&ovalue=<?=$arr[$i][0]?>" target="_blank"><?=$arr[$i][1]?></a></dt>
						<?php
							$dsql->SetQuery("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '".$arr[$i][0]."' order by a.id desc limit 6");
							$dsql->Execute();
							while($row = $dsql->GetArray())
							{
								echo "<dd><a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'],16)."</a></dd>";
							}
						?>
						
					</dl>
					<?php if(($i%4) != 0){ ?><p class="xxx"></p><?php }?>
				<?php
				}
				?>
			</div>
		</div>
<!--- end------> 
   	<div class="height_3"></div>
<!--- 会员留言  start------>
		<!-- <div class="cn_box01 height226">
			<h2 class="box_title">会员留言</h2>
			<ul class="one_row_box03 font12 no_ico dw01">
				<li class="clearfix"><a href="" target="">请教一个关于放弃优先购买权的问题 </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">关于正当防卫和防卫过当以及故意伤害的问题 </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">提前退租房东不退押金以及违约金收取合理吗？ </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">只有录音和短信能申请支付令吗？ </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">在工地上班受伤赔偿问题 </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">想问一下这经营方式合法吗？ </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">想请问一下，偶发现了某银行网上银行资金安全漏洞 </a><span> 12/09 </span></li>
				<li class="clearfix"><a href="" target="">帮帮忙 辞职不成！能通过法律维权嘛？ 跪谢！！！  </a><span> 12/09 </span></li>
			</ul>
		</div> -->
<!--- end------> 
	</div>
	<div class="right">
<!--- 热门合同 合同咨询  start------>
		<div class="cn_box01 height269">
			<h2 class="box_title">热门合同</h2>
			<div class="hot_ht_box">
			<?php
				$dsql->SetQuery("select * from object_contract_type limit 10");
				$dsql->Execute();
				$i = 1;
				$arr = Array();
				while($row = $dsql->GetArray())
				{
					$arr[$i][0] = $row['id'];
					$arr[$i][1] = $row['val'];
					$i++;
				
				}
				for($i = 1; $i < (count($arr) + 1); $i++){
			?>
			<dl class="hot_ht clearfix">
				<dt><a href="/content-list.php?tid=218&oname=18&ovalue=<?=$arr[$i][0]?>&hot=1" target="_blank"><?=str_replace('合同', '', $arr[$i][1]);?></a></dt>
				<dd>
				<?php
					$dsql->SetQuery("SELECT a . * , c.flag FROM article_options_mapping a, cms_arctiny b, cms_archives c WHERE a.topicid =  '218' AND a.article_id = b.id AND a.article_id = c.id AND b.arcrank !=  '-2' AND option_keyname =  'contract_type_title' AND option_value = '".$arr[$i][0]."' ORDER BY a.id DESC LIMIT 5");
					$dsql->Execute();
					while($row = $dsql->GetArray())
					{
						echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".SubTitle($row['article_title'], 10)."</a> ";
					}
				?>
				</dd>
			</dl>
			<?}?>
		</div>
	</div>	
<!--- end------> 
   	<div class="height_3"></div>
<!--- 律师天地  start------>
		<div class="cn_box01" style="height:562px">
			<h2 class="box_title">法律学人天地</h2>
			<ul class="pic_box03 clearfix">
				<?
					$tpl = '<li><a href="/info.php?id={{id}}" target="_blank"><img src="{{litpic}}" width="69" height="86" border="0"/></a><span>{{title}}<br/><!--<font style="color:#000">13901351912</font><br/><a href="" target="">[点此咨询] </a></span>--></li>';
					echo show_title_list('2', $tpl, 16, 0, 10);
				?>
			</ul>
			<p class="more_box"><a href="./content-list.php?tid=2" target="_blank" class="more">More..</a><p>
		</div>
<!--- end------>
   	<div class="height_3"></div>
<!--- 征稿启事  start------>	
		<!--<div class="collect white height404">
			<h1>找不到合同</h1>
			<p>如果在《合同范本》频道中找不到需要的合同，可在此提交需要合同范本的主题、用途。我们会在第一时间内为您找到。<a href="" target="" class="blue">看看别人都在找什么?</a></p>
			<p><textarea class="textarea_ht">sdfasdfasdfa</textarea></p>
			<p><input id="" type="button" name="" value="提交合同范本信息" class="tj_ht_info"/></p>
			<h2 class="xglj_ht_info">相关链接</h2>
			<ul class="one_row_box02 no_ico no_padding">
				<li><a href="" target="">中华人民共和国宪法</a></li>
				<li><a href="" target="">中华人民共和国刑法</a></li>
				<li><a href="" target="">中华人民共和国民法</a></li>
				<li><a href="" target="">中华人民共共和国居民身份证法</a></li>
				<li><a href="" target="">中华人民共和国兵役法</a></li>
				<li><a href="" target="">中华人民共共和国居民身份证法</a></li>
			</ul>
		</div>-->
<!--- end------>	

	</div>	
	<div class="clear"></div> 
   	<div class="height_10"></div>
<!--- 合同范本导航  start------>
		<div class="cn_box01">
			<h2 class="box_title">合同范本导航</h2>
			<div class="padding15">
				<?php
					$dsql->SetQuery("select * from object_contract_type");
					$dsql->Execute();
					$i = 1;
					$arr = Array();
					while($row = $dsql->GetArray())
					{
						$arr[$i][0] = $row['id'];
						$arr[$i][1] = $row['val'];
						$i++;
					}
					for($i = 1; $i < (count($arr) + 1); $i++){
				?>
				<dl class="list_style01 clearfix">
					<dt>[<a href="/content-list.php?tid=218&oname=18&ovalue=<?=$arr[$i][0]?>" target="_blank" style="color:#2263AC"><?=$arr[$i][1]?></a>] </dt>
					<dd>
					<?php
						$dsql->SetQuery("select a.* From article_options_mapping a, cms_arctiny b where a.topicid = '218' and a.article_id=b.id and b.arcrank != '-2' and option_keyname = 'contract_type_title' and option_value = '".$arr[$i][0]."' order by a.id desc limit 10");
						$dsql->Execute();
						while($row = $dsql->GetArray())
						{
							echo "<a href=\"/info.php?id=".$row['article_id']."\" target=\"_blank\">".$row['article_title']."</a> ";
						}
					?>
					</dd>
				</dl>
				<?php
				}
				?>
			</div>
		</div>
<!--- end------>
	</div>
<?php
require_once('common/footer.php');
?>